<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let arr = [22, 3, 54, 12, 66, 1];
        arr.sort();// 无参，默认按字符串排序
        console.log(arr);

        let arr1 = [22, 3, 54, 12, 66, 1];
          // 数字排序
          arr1.sort(function (a, b) {
            return a - b;
        });
        console.log(arr1);

      
        


    </script>
</body>
</html>